Carbon


SndDoImmediate

Header: Sound.h Carbon status: Supported

Places a sound command in front of a sound channel’s command queue.

OSErr SndDoImmediate (
    SndChannelPtr chan, 
    const SndCommand *cmd
);
Parameter descriptions
chan

A pointer to a sound channel.

cmd

A sound command to be sent to the channel specified in the chan parameter. See “Sound Command Numbers A”.

function result

A result code.

DISCUSSION

The SndDoImmediate function operates much like SndDoCommand, except that it bypasses the existing command queue of the sound channel and sends the specified command directly to the Sound Manager for immediate processing. This function also overrides any waitCmd, pauseCmd, or syncCmd commands that might have already been processed. However, other commands already received by the Sound Manager will not be interrupted by the SndDoImmediate function (although a quietCmd command sent via SndDoImmediate will quiet a sound already playing).

SPECIAL CONSIDERATIONS

Whether SndDoImmediate moves memory depends on the particular sound command you’re sending it. Most of the available sound commands do not cause SndDoImmediate to move memory and can therefore be issued at interrupt time. Moreover, you can sometimes safely send commands at interrupt time that would otherwise cause memory to move if you’ve previously issued the soundCmd sound command to preconfigure the channel at noninterrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)